<extend name="Public/base"/>
<block name="body">
    <div class="main-title">
        <h2>{:L('_PACK_STEP_ONE_')}
            <small>{:L('_PACK_STEP_ONE_VICE_')}</small>
        </h2>
    </div>

    <div class="with-padding">
        <div class="clearfix">

            <div class="alert alert-info">
                {:L('_PACK_MODULE_NOW_')}{:L('_COMMA_')}<strong>{$module.alias}-{$module.name}</strong>
            </div>
        </div>
        <form action="{:U('module2')}" method="post">
            <div class="clearfix">
                <eq name="created" value="1">
                    <div class="col-xs-12">
                        <p class="lead">{:L('_PACK_DETECTED_MENU_TREE_')}</p>
                        <blockquote>
                            <volist name="menus" id="one">
                                <eq name="one.hide" value="1">
                                    <php>$class='text-mute';</php>
                                    <else/>
                                    <php>$class='text-primary';</php>
                                </eq>
                                <span class="{$class}"> <p>{:L('_BRACKETS_LEFT_')}1{:L('_CLASS_')}{:L('_BRACKETS_RIGHT_')}{$one.id}-{$one.title}-{$one.url}</p></span>
                                <empty name="one._">
                                    <else/>
                                    <volist name="one._" id="two">
                                        <eq name="two.hide" value="1">
                                            <php>$class1='text-mute';</php>
                                            <else/>
                                            <php>$class1='text-primary';</php>
                                        </eq>
                                    <span class="{$class1}"><p>
                                        &nbsp; &nbsp; &nbsp; &nbsp;{:L('_BRACKETS_LEFT_')}2{:L('_CLASS_')}{:L('_BRACKETS_RIGHT_')}{$two.id}-{$two.title}-{$two.url}
                                    </p></span>
                                        <volist name="two._" id="three">
                                            <eq name="three.hide" value="1">
                                                <php>$class1='text-mute';</php>
                                                <else/>
                                                <php>$class1='text-primary';</php>
                                            </eq>
                                    <span class="{$class1}"><p>
                                        &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{:L('_BRACKETS_LEFT_')}3{:L('_CLASS_')}{:L('_BRACKETS_RIGHT_')}{$three.id}-{$three.title}-{$three.url}
                                    </p></span>
                                        </volist>
                                    </volist>
                                </empty>


                            </volist>
                        </blockquote>
                        <neq name="havent_created" value="">
                            <p class="lead">{:L('_PACK_DETECTED_MENU_TREE_LOST_')}</p>

                            <blockquote>

                                <volist name="havent_created" id="vo">
                                    <p class="text-danger">{$_SESSION.module}Controller->{$vo.name}()</p>
                                </volist>


                            </blockquote>

                            <div class="clearfix">
                                <div class="col-xs-6">
                                    <div class="form-group">
                                        <label>
                                            <input id="ignore" type="checkbox" value="1"> {:L('_PACK_IGNORE_')}
                                        </label>
                                        <script>
                                            $(function () {
                                                $('#ignore').change(function () {
                                                    if ($('#ignore').prop('checked')) {
                                                        $('#next_step').removeAttr("disabled");
                                                    } else {
                                                        $('#next_step').attr("disabled", true);
                                                    }
                                                })
                                            })
                                        </script>
                                    </div>
                                </div>
                                <div class="col-xs-6">
                                    <a target="_blank" href="{:U('menu/index')}" class="btn btn-default">{:L('_PACK_MENU_COMPLETE_')}</a>
                                </div>

                            </div>
                            <neq name="havent_created" value="">
                                <span class="text-danger">{:L('_PACK_MUST_CHECK_')}</span>
                            </neq>
                        </neq>
                    </div>
                    <div class="col-xs-12">
                        <p class="lead">{:L('_PACK_SCRIPT_PREVIEW_')}</p>
                    <textarea name="menus" class="form-control" style="height: 200px">{:json_encode($menus)}</textarea>
                    </div>
                    <else/>
                    <div class="alert alert-success col-xs-6">{:L('_PACK_CAN_SKIP_')}</div>
                </eq>

            </div>

            <div class="with-padding">
                <a class="btn btn-lg btn-default" href="{:U('module')}">
                    {:L('_STEP_PREV_')}
                </a>
                <a class="btn btn-lg btn-default" href="{:U('module1')}">
                    <i class="icon-refresh"></i> {:L('_DETECT_RE_')}
                </a>
                <neq name="havent_created" value="">
                    <php>$str='disabled="disabled"';</php>
                    </ph>
                </neq>

                <input type="submit" id="next_step" style="width: 300px" title="{$title}" {$str} class="btn btn-lg btn-success"
                   value="{:L('_STEP_NEXT_')}">

                </input>


            </div>
        </form>



    </div>
</block>